package net.jarang.study.spring.board;

import java.util.Map;

import net.jarang.study.spring.annotation.User;
import net.jarang.study.spring.task.Task;

public class VisitBO {
	private Map<String, Task> tasks;
	private VisitDAO visitDAO;
	
	public void setTasks(Map<String, Task> tasks) {
		this.tasks = tasks;
	}
	
	public void setVisitDAO(VisitDAO visitDAO) {
		this.visitDAO = visitDAO;
	}
	
	public void visit(String userId) {
		if (tasks != null) {
			for (Map.Entry<String, Task> entry : tasks.entrySet()) {
				System.out.println("bean id : " + entry.getKey());
				System.out.println("bean value : " + entry.getValue());
			}
		}
		visitDAO.insert(userId);
	}

	public User selectUser(String userId) {
		User user = new User();
		user.setId(10);
		user.setName("홍길동");
		user.setAge(30);
		user.setPoint(12344);
		return user;
	}
}
